/*
 * Matrix.cpp
 *
 *  Created on: 2010-06-19
 *      Author: Daniel
 */

#include "../inc/Matrix.h"

#include <stdlib.h>

Matrix::Matrix(int _n, int _m) {
	n=_n;
	m=_m;
	tab = (float*) calloc(n*m,sizeof(float));
}

Matrix::~Matrix() {
	free(tab);
}

float Matrix::get(int x,int y) const{
	return tab[idx(x,y)];
}

void Matrix::set(int x, int y, float val) {
	 tab[idx(x,y)]=val;
}
int Matrix::getColumnsNumber() const{
	return m;
}
int Matrix::getRowsNumber() const {
	return n;
}
